/*  Interface to rtstar
    Copyright (C) 2006 REC GmbH

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA*/

#ifndef _RTSTAR_INTERFACE_H_
#define _RTSTAR_INTERFACE_H_


typedef struct
{
  unsigned int timestamp;
  unsigned char roomId;
  unsigned char numSpotsVisible;
  signed short posX;
  signed short posY;
  float posTheta;
  unsigned short magSpot0;
  unsigned short magSpot1;
} northStarData;

typedef struct
{
// read only variables
  // 0: all clear
  // 1: not connected
  unsigned char status;
  unsigned char version;
  northStarData read[2];

// writeable data
  char roomId;

  /**0: start rotation 1: stop rotation 2: start linear 3: stop linear 4: stop cal*/
  unsigned char calState;
  /**0: nix neues 1: neue Calibrierungspose*/
  unsigned char calFlag;
  unsigned short calDistance;

// control
  unsigned char r_current_buffer;
  unsigned char r_lock;
} rtstar_data;

#define RTSTAR_MBUFF   "rtstar_mbuff"
#define RTSTAR_MBUFF_SIZE (sizeof(rtstar_data))

#endif
